package com.bwie.utils;

import lombok.Data;

import java.io.Serializable;

/**
 * @Title:
 * @BelongProjecet zk3
 * @BelongPackage com.bwie.utils
 * @Description:
 * @Copyright 研发一部
 * @Author: Mr.yan
 * @Date: 2024/6/12 9:00
 * @Version V1.0
 */
@Data
public class R implements Serializable {

    private Integer code;
    private String msg;
    private Object data;

    public static R success(){
        R r = new R();
        r.setCode(200);
        r.setMsg("操作成功");
        return r;
    }

    public static R success(Object data){
        R r = new R();
        r.setCode(200);
        r.setMsg("操作成功");
        r.setData(data);
        return r;
    }

    public static R error(Integer code,String msg){
        R r = new R();
        r.setCode(code);
        r.setMsg(msg);
        return r;
    }

}
